<include file="__THEME__/public_header" />
<link href="__APP__/rank.css" rel="stylesheet" type="text/css" />
   <div id="page-wrap">
	   <div id="main-wrap">
        <div class="boxShadow">
        	    <div class="find-type">
	   	   	   	   <div class="app-title clearfix">
	   	   	   	   <h4 class="left"><img src="__APP__/image/ico-app-account.png" />&nbsp;&nbsp;排行榜</h4>                       
                        <div class="app-tab-menu clearfix" style="margin:0 0 0 130px;">
                          
                           <ul>
                             <li>
                               <a class="current" href="{:U('public/Rank/weibo')}">微博排行榜<span class="triangle"></span></a><i class="line"></i>  
                             </li>
                             <li>
                               <a href="{:U('public/Rank/topic')}">话题排行榜</a><i class="line"></i>  
                             </li>
                             <li>
                               <a href="{:U('public/Rank/index','type=2')}">用户排行榜</a><i class="line"></i>  
                             </li>
                             <li>
                                <a href="{:U('public/Rank/index')}">好友排行榜</a></i>  
                             </li>
                           </ul>
                        </div>
                    </div>
                  </div>
            <div class="rank-bg">
	   	   	   <div class="rank-content clearfix">
              <div id="col3" class="st-index-right">
                  <div class="right-wrap">
                      <div class="rank-box1 rank-box2">
                          <h3>热门话题榜</h3>
                          <ul>
                             <volist name="tlright" id="v">
                             <li>
                                <i class="ico-num ico-num{$key+1}"></i>
                                <a href="{:U('public/Topic/index',array('k'=>$v['topic_name']))}" target="_blank">{$v.topic_name}</a>
                             </li>
                             </volist>
                          </ul>
                      </div>
                      <div class="rank-box1 rank-box2">
                          <h3>粉丝排行榜</h3>
                          <ul>
                          <volist name="flright" id="v">
                             <li>
                                <i class="ico-num ico-num{$key+1}"></i>
                                <a href="{:U('public/Profile/index',array('uid'=>$v['uid']))}" target="_blank">{$v.uname}</a>
                             </li>
                            </volist>
                          </ul>
                      </div>
                  </div>
              </div>
              <div id="col5" class="st-index-main">
                 <div class="extend-foot">
                     <div class="feed-nav">
                         <div class="tab-menu">
                            <ul>
                               <li <php>if(!$order){</php>class="current"<php>}</php>><span><a href="{:U('public/Rank/weibo')}" >最多评论</a></span></li>
                               <li <php>if($order==2){</php>class="current"<php>}</php>><span><a href="{:U('public/Rank/weibo',array('order'=>2))}" >最多转发</a></span></li>
                               <li <php>if($order==3){</php>class="current"<php>}</php>><span><a href="{:U('public/Rank/weibo',array('order'=>3))}" >最多赞</a></span></li>
                            </ul>
                          </div>
                      </div>
<div id="feed-lists" class="feed_lists clearfix">
<php> $cancomment = intval(CheckPermission('core_normal','feed_comment')); </php>
<volist name='data' id ='vl'>
	<php>
		$cancomment_old = empty($vl['app_row_id'])  ? 0 : 1;
	</php>
	<dl class="feed_list"  id ='feed{$vl.feed_id}' model-node='feed_list'>
	<dt class="face">
	<a href="{$vl['user_info']['space_url']}"><img src="{$vl['user_info']['avatar_small']}"  event-node="face_card" uid='{$vl['user_info']['uid']}'></a></dt>
	<dd class="content">
    <span event-node="show_admin" event-args="feed_id={$vl['feed_id']}&uid={$vl['user_info']['uid']}&feed_del={:CheckPermission('core_admin','feed_del')}&channel_recommend={:CheckPermission('channel_admin','channel_recommend')}&vtask_recommend={:CheckPermission('vtask_admin','vtask_recommend')}" href="javascript:;" class="right f12 f9 hover" style="display:none;cursor:pointer">管理</span>
	<eq name='vl.is_del' value='0'>
	<p class="hd">{$vl.title}
	<volist name="vl['GroupData'][$vl['uid']]" id="v2">
        <img style="width:auto;height:auto;display:inline;cursor:pointer;" src="{$v2['user_group_icon_url']}" title="{$v2['user_group_name']}" />&nbsp;
    </volist>
	<php> if(in_array($vl['user_info']['uid'],$followUids)){</php>
	{:W('Remark',array('uid'=>$vl['user_info']['uid'],'remark'=>$remarkHash[$vl['user_info']['uid']],'showonly'=>1))}
	<php>}</php>
	<php>if(!empty($vl['body'])){</php><php>}</php>
	</p>
	<span class="contents">{$vl.body|format=true}</span>
	
	<p class="info">
	<span class="right">
	{:W('Digg', array('feed_id'=>$vl['feed_id'], 'digg_count'=>$vl['digg_count'], 'diggArr'=>$diggArr))}
	<i class="vline">|</i>
	<php>if(in_array('repost',$weibo_premission)):</php>
	<eq name='vl.actions.repost' value='true'>
	<php>if(CheckPermission('core_normal','feed_share')){</php>
	<php>
		$sid = !empty($vl['app_row_id'])? $vl['app_row_id'] : $vl['feed_id'];
		$cancomment_old = in_array($vl['type'],$cancomment_old_type) ? 1 : 0;
	</php>
	{:W('Share',array('sid'=>$sid,'stable'=>$vl['app_row_table'],'initHTML'=>'','current_table'=>'feed','current_id'=>$vl['feed_id'],'nums'=>$vl['repost_count'],'appname'=>$vl['app'],'cancomment'=>$cancomment_old,'feed_type'=>$vl['type'],'is_repost'=>$vl['is_repost']))}
	<i class="vline">|</i>
	<php>}</php>
	</eq>
	<php>endif;</php>
	
	<eq name='vl.actions.favor' value='true'>
		{:W('Collection',array('type'=>$type,'sid'=>$vl['feed_id'],'stable'=>'feed','sapp'=>$vl['app']))}
	</eq>

	<php>if(in_array('comment',$weibo_premission)):</php>
	<eq name='vl.actions.comment' value='true'>
		<i class="vline">|</i>
		<a event-node="comment" href="javascript:void(0)" event-args='row_id={$vl.feed_id}&app_uid={$vl.uid}&app_row_id={$vl.app_row_id}&app_row_table={$vl.app_row_table}&to_comment_id=0&to_uid=0&app_name={$vl.app}&table=feed&cancomment={$cancomment}&cancomment_old={$cancomment_old}'>{:L('PUBLIC_STREAM_COMMENT')}<neq name='vl.comment_count' value='0'> ({$vl.comment_count}) </neq></a>
	</eq>
	<php>endif;</php>

	</span>
     <span>
	<a class="date" date="{$vl.publish_time}" href="{:U('public/Profile/feed',array('feed_id'=>$vl['feed_id'],'uid'=>$vl['uid']))}">{$vl.publish_time|friendlyDate}</a>
	<span>{$vl['from']}</span>
	
	<em class="hover">
	<eq name='vl.actions.delete' value='true'>
	<!-- 做普通删除权限 和 管理删除权限 判断 & 只有微博可以被删除  -->
	<php>if(($vl['user_info']['uid'] == $GLOBALS['ts']['mid'] && CheckPermission('core_normal','feed_del')) || CheckPermission('core_admin','feed_del')){</php>
		<a href="javascript:void(0)" event-node ='delFeed' event-args='feed_id={$vl.feed_id}&uid={$vl.user_info.uid}'>{:L('PUBLIC_STREAM_DELETE')}</a>
	<php>}</php>
	</eq>
	<php>if($vl['user_info']['uid'] != $GLOBALS['ts']['mid']){</php>
	<php>if(CheckPermission('core_normal','feed_report')){</php>
	<a href="javascript:void(0)" event-node='denounce' event-args='aid={$vl.feed_id}&type=feed&uid={$vl.user_info.uid}'>{:L('PUBLIC_STREAM_REPORT')}</a>
	<php>}</php>
	<php>}</php>
	</em>
    </span>
</p>
	   <div model-node="comment_detail" class="repeat clearfix" style="display:none;"></div>
 	
 	<else />
	
	<p>{:L('PUBLIC_INFO_ALREADY_DELETE_TIPS')}</p>
	<p class="info">
		<eq name='vl.actions.favor' value='true'>
		{:W('Collection',array('type'=>$type,'sid'=>$vl['feed_id'],'stable'=>'feed','sapp'=>$vl['app']))}
	</eq>
	</p>
	</eq> 
	   
	</dd>
	</dl>
</volist>
</div>
                  </div> 
              </div>    
           	 </div>
           	</div>
        </div>
	   </div>
</div>

<script type="text/javascript">
  //旋转图片
function revolving (type, id) {
  var img = $("#image_index_"+id);
  img.rotate(type);
}


$.fn.rotate = function(p){

  var img = $(this)[0],
    n = img.getAttribute('step');
  // 保存图片大小数据
  if (!this.data('width') && !$(this).data('height')) {
    this.data('width', img.width);
    this.data('height', img.height);
  };
  this.data('maxWidth',img.getAttribute('maxWidth'))

  if(n == null) n = 0;
  if(p == 'left'){
    (n == 0)? n = 3 : n--;
  }else if(p == 'right'){
    (n == 3) ? n = 0 : n++;
  };
  img.setAttribute('step', n);

  // IE浏览器使用滤镜旋转
  if(document.all) {
    if(this.data('height')>this.data('maxWidth') && (n==1 || n==3) ){
      if(!this.data('zoomheight')){
        this.data('zoomwidth',this.data('maxWidth'));
        this.data('zoomheight',(this.data('maxWidth')/this.data('height'))*this.data('width'));
      }
      img.height = this.data('zoomwidth');
      img.width  = this.data('zoomheight');
      
    }else{
      img.height = this.data('height');
      img.width  = this.data('width');
    }
    
    img.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(rotation='+ n +')';
    // IE8高度设置
    if ($.browser.version == 8) {
      switch(n){
        case 0:
          this.parent().height('');
          //this.height(this.data('height'));
          break;
        case 1:
          this.parent().height(this.data('width') + 10);
          //this.height(this.data('width'));
          break;
        case 2:
          this.parent().height('');
          //this.height(this.data('height'));
          break;
        case 3:
          this.parent().height(this.data('width') + 10);
          //this.height(this.data('width'));
          break;
      };
    };
  // 对现代浏览器写入HTML5的元素进行旋转： canvas
  }else{
    var c = this.next('canvas')[0];
    if(this.next('canvas').length == 0){
      this.css({'visibility': 'hidden', 'position': 'absolute'});
      c = document.createElement('canvas');
      c.setAttribute('class', 'maxImg canvas');
      img.parentNode.appendChild(c);
    }
    var canvasContext = c.getContext('2d');
    switch(n) {
      default :
      case 0 :
        img.setAttribute('height',this.data('height'));
        img.setAttribute('width',this.data('width'));
        c.setAttribute('width', img.width);
        c.setAttribute('height', img.height);
        canvasContext.rotate(0 * Math.PI / 180);
        canvasContext.drawImage(img, 0, 0);
        break;
      case 1 :
        if(img.height>this.data('maxWidth') ){
          h = this.data('maxWidth');
          w = (this.data('maxWidth')/img.height)*img.width;
        }else{
          h = this.data('height');
          w = this.data('width');
        }
        c.setAttribute('width', h);
        c.setAttribute('height', w);
        canvasContext.rotate(90 * Math.PI / 180);
        canvasContext.drawImage(img, 0, -h, w ,h );
        break;
      case 2 :
        img.setAttribute('height',this.data('height'));
        img.setAttribute('width',this.data('width'));
        c.setAttribute('width', img.width);
        c.setAttribute('height', img.height);
        canvasContext.rotate(180 * Math.PI / 180);
        canvasContext.drawImage(img, -img.width, -img.height);
        break;
      case 3 :
        if(img.height>this.data('maxWidth') ){
          h = this.data('maxWidth');
          w = (this.data('maxWidth')/img.height)*img.width;
        }else{
          h = this.data('height');
          w = this.data('width');
        }
        c.setAttribute('width', h);
        c.setAttribute('height', w);
        canvasContext.rotate(270 * Math.PI / 180);
        canvasContext.drawImage(img, -w, 0,w,h);
        break;
    };
  };
};
</script>

<include file="__THEME__/public_footer" />
<script src="__THEME__/js/module.weibo.js"></script>